package com.bdqn.jiang.Service.impl;

import com.bdqn.jiang.Service.BaseService;
import com.bdqn.jiang.utils.ServiceFactory;

import java.util.List;
import java.util.Scanner;

public class StartServesImpl implements BaseService {
    Scanner sc=new Scanner(System.in);








    @Override
    public void execute(List list) {
        System.out.println("欢迎使用阅读器");
        for (;;){
            System.out.println("1.登录");

            System.out.println("2.注册");

            System.out.println("3.退出");

            int xuanzhe1=sc.nextInt();

            switch (xuanzhe1){
                case 1:
                    BaseService baseService = ServiceFactory.getService("login");
                    baseService.execute(list);
                    break;
                case 2:
                    BaseService baseService1 = ServiceFactory.getService("register");
                    baseService1.execute(list);
                    break;
                case 3:
                    System.out.println("欢迎下次光临！");

                    System.exit(0);

                    break;

                default:
                    System.out.println("输入错我请重新输入");
                    break;
            }
        }
    }


}
